package com.service.admin.team.controller;

import com.service.admin.base.service.MemberStarGradeConfigService;
import com.service.admin.member.service.MemberService;
import com.service.admin.order.service.OrderProductHrComboService;
import com.service.admin.team.controller.rep.TeamPageRep;
import com.service.admin.team.controller.req.IssuedTeamRewardReq;
import com.service.admin.team.controller.req.TeamPageReq;
import com.service.core.rest.BaseController;
import com.service.core.rest.request.BaseRequest;
import com.service.core.rest.response.BaseResponse;
import com.service.core.rest.response.PageResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(tags = "团队相关")
@RestController
@RequestMapping("/team")
public class TeamController extends BaseController {

    @Autowired
    private MemberService memberService;

    @Autowired
    private MemberStarGradeConfigService memberStarGradeConfigService;

    @Autowired
    private OrderProductHrComboService orderProductHrComboService;

    @ApiOperation("分页")
    @PostMapping("page")
    public PageResponse<TeamPageRep> pageTeam(@ApiParam @RequestBody TeamPageReq req){
        return successQueryPageResponse(memberService.pageMemberTeamByParam(req));
    }

    public BaseResponse issuedTeamReward(@ApiParam @RequestBody IssuedTeamRewardReq req){
        memberService.issuedTeamReward(req);
        return successBaseResponse();
    }
}
